home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-24 | 1.0 KB | 49 lines | [TEXT/PJMM] |
- unit MyTranslate82728;
-
- { This code is part of the Finger/Fingerd source code, written in THINK Pascal 4 }
- { Copyright 1991-1992 Peter N Lewis }
- { If you use this code, you must give me credit in your about box and documentation }
- { This is part of my generic library of routines }
-
- interface
-
- const
- translateResType = 'taBL';
- translateOutResID = 128;
- translateInresID = 129;
-
- type
- transTable = array[0..255] of signedByte;
-
- procedure GetTrans (id: integer; var trans: transTable);
-
- implementation
-
- uses
- MyPreferences;
-
- procedure GetTrans (id: integer; var trans: transTable);
- var
- th: handle;
- s: str255;
- tfs: FSSpec;
- tres, i: integer;
- begin
- GetPrefsFSSpec(tfs);
- tres := HOpenResFile(tfs.vRefNum, tfs.parID, 'Translate 7<->8', fsRdPerm);
- th := GetResource(translateResType, id);
- if th = nil then
- for i := 0 to 255 do
- {$PUSH}
- {$R-}
- trans[i] := i
- {$POP}
- else begin
- BlockMove(th^, @trans, SizeOf(trans));
- ReleaseResource(th);
- end;
- if tres <> -1 then
- CloseResFile(tres);
- end;
-
- end.